package com.suixinsanren.design.state.study.demo04;

public class NoQuarterState implements State {

    private GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("你插入了一个25美分的硬币");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void ejectQuarter() {
        System.out.println("你还没有插入25美分的硬币");
    }

    @Override
    public void turnCrank() {
        System.out.println("需要先投入25分钱");
    }

    @Override
    public void dispense() {
        System.out.println("需要先投入25分钱");
    }
}
